<?php

namespace App\Http\Form\EleTakeaway;


use App\Http\Form\AnalysisFormContent;
use App\Http\Form\Form;
use App\Http\Form\FormAttribute;
use App\Http\Form\FormInterface;
use App\Http\Form\FormValidate;
use App\Models\WorkOrder\WorkOrderApplyContentModel;
use App\Support\CustomForm\Attribute\AttributeMapSupport;
use App\Support\CustomForm\Attribute\AttributeSupport;
use App\Support\CustomForm\Validate\ValidateSupport;
use App\Support\Facade\CustomerValidator;
use Illuminate\Support\Collection;
use Illuminate\Validation\Validator;

/**
 * @property EleTakeawayFormAttribute shopCode
 * @property EleTakeawayFormAttribute shopName
 * @property EleTakeawayFormAttribute address
 * @property EleTakeawayFormAttribute detailAddress
 * @property EleTakeawayFormAttribute businessTime
 * @property EleTakeawayFormAttribute mobile
 * @property EleTakeawayFormAttribute reserveMobile
 * @property EleTakeawayFormAttribute shopCharge
 * @property EleTakeawayFormAttribute doorHeaderImg
 * @property EleTakeawayFormAttribute shopInnerImg
 * @property EleTakeawayFormAttribute cashierSystem
 *
 * 证照信息
 * @property EleTakeawayFormAttribute businessLicenseImg
 * @property EleTakeawayFormAttribute enterpriseName
 * @property EleTakeawayFormAttribute businessLicenseNumber
 * @property EleTakeawayFormAttribute foodBusinessLicenseImg
 * @property EleTakeawayFormAttribute legalPerson
 * @property EleTakeawayFormAttribute permitLicenseNumber
 * @property EleTakeawayFormAttribute businessPremises
 * @property EleTakeawayFormAttribute effectiveTimeStartDate
 * @property EleTakeawayFormAttribute effectiveTimeEndDate
 *
 *
 * @property EleTakeawayFormAttribute collectionType
 *
 * @property EleTakeawayFormAttribute accountOpenPermitImg
 * @property EleTakeawayFormAttribute bankReceiptImg
 * @property EleTakeawayFormAttribute legalPersonIdentityCardFront
 * @property EleTakeawayFormAttribute legalPersonIdentityCardBack
 * @property EleTakeawayFormAttribute legalPersonIdentityCardValidityPeriod
 * @property EleTakeawayFormAttribute legalPersonIdentityCardWithFront
 * @property EleTakeawayFormAttribute legalPersonIdentityCardWithBack
 * @property EleTakeawayFormAttribute legalPersonUsername
 * @property EleTakeawayFormAttribute legalPersonIdentityCardNumber
 *
 * @property EleTakeawayFormAttribute collectionPersonIdentityCardFront
 * @property EleTakeawayFormAttribute collectionPersonIdentityCardBack
 * @property EleTakeawayFormAttribute collectionPersonIdentityCardValidityPeriod
 * @property EleTakeawayFormAttribute collectionPersonIdentityCardWithFront
 * @property EleTakeawayFormAttribute collectionPersonIdentityCardWithBack
 * @property EleTakeawayFormAttribute collectionPersonUsername
 * @property EleTakeawayFormAttribute collectionPersonIdentityCardNumber
 * @property EleTakeawayFormAttribute collectionEqBankCard
 * @property EleTakeawayFormAttribute personWithBusinessLicenseAndIdCardFrontImg
 * @property EleTakeawayFormAttribute operatorAuthorizationLetter
 * @property EleTakeawayFormAttribute bankCardImgFront
 * @property EleTakeawayFormAttribute bankCardImgBack
 *
 * @property EleTakeawayFormAttribute accountBank
 * @property EleTakeawayFormAttribute provinceBank
 * @property EleTakeawayFormAttribute accountBranchBank
 * @property EleTakeawayFormAttribute collectionBankAccount
 * @property EleTakeawayFormAttribute bankReserveMobile
 *
 *
 * @property EleTakeawayFormAttribute foodCityGearList
 * @property EleTakeawayFormAttribute shopInFoodCity
 * @property EleTakeawayFormAttribute eleShopWithGearCommitmentLetter
 * @property EleTakeawayFormAttribute operatorWithHealthCertificate
 * @property EleTakeawayFormAttribute foodCityVideo
 *
 * @property EleTakeawayFormAttribute shopSupervisorName
 * @property EleTakeawayFormAttribute shopSupervisorMobile
 * @property EleTakeawayFormAttribute communicationTime
 * @property EleTakeawayFormAttribute evaluationScreenshot
 *
 * @property EleTakeawayFormAttribute expectOpenTime
 */
class EleTakeawayForm extends Form implements FormInterface
{

    /**
     * 门店信息表单
     */
    public function shopInfoForm(Collection $formContent)
    {
        EleTakeawayFormAttribute::getInstance(
            "shopCode",
            AttributeSupport::INPUT_TYPE_STRING,
            "门店编号"
        )->setValidateRules(
            EleTakeawayFormValidate::getInstance()->setRequired(true)
                                   ->setDataType(ValidateSupport::DATA_TYPE_STRING)
                                   ->setContentLength(0, 6)
        )->setCustomAttribute(
            ["disabled", true],
            ["placeholder", "请填写门店编号"]
        )->setValue(
            $formContent, ""
        )->setBeforeBuildHandle(
            function (AttributeSupport $attributeSupport) use ($formContent) {
                if (!$formContent->get("shopCode")) {
                    $attributeSupport->setCustomAttribute(["disabled", false]);
                }
            }
        );

        EleTakeawayFormAttribute::getInstance(
            "shopName",
            AttributeSupport::INPUT_TYPE_STRING,
            "门店名称"
        )->setValidateRules(
            EleTakeawayFormValidate::getInstance()->setRequired(true)
                                   ->setDataType(ValidateSupport::DATA_TYPE_STRING)
                                   ->setContentLength(0, 36)
        )->setPlaceholder(
            "请填写门店名称"
        )->setValue($formContent, "");


        EleTakeawayFormAttribute::getInstance(
            "address",
            AttributeSupport::INPUT_TYPE_ADDRESS,
            "所在省市区"
        )->setValidateRules(
            EleTakeawayFormValidate::addressValidate()
        )->setPlaceholder(
            "请选择所在省市区"
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "detailAddress",
            AttributeSupport::INPUT_TYPE_TEXT,
            "详细地址"
        )->setValidateRules(
            EleTakeawayFormValidate::getInstance()->setRequired(true)
                                   ->setDataType(ValidateSupport::DATA_TYPE_STRING)
                                   ->setContentLength(0, 120)
        )->setPlaceholder(
            "请填写详细地址"
        )->setValue($formContent, "");


        EleTakeawayFormAttribute::getInstance(
            "businessTime",
            AttributeSupport::INPUT_DATE_TIME_RANGE,
            "营业时间"
        )->setValidateRules(
            EleTakeawayFormValidate::dateRangeValidate(FormValidate::DATE_VALIDATE_FORMAT_5, false)
        )->setPlaceholder(
            "请选择营业时间"
        )->setDateFormat(
            AttributeSupport::DATE_FORMAT_5
        )->setValue($formContent, ["startTime" => "10:00", "endTime" => "22:00"]);


        EleTakeawayFormAttribute::getInstance(
            "mobile",
            AttributeSupport::INPUT_TYPE_MOBILE,
            "建店手机号"
        )->setValidateRules(
            EleTakeawayFormValidate::mobileValidate()
        )->setCustomAttribute(
            ["placeholder", "用作饿了么外卖管理账号"]
        )->setValue($formContent, "");


        EleTakeawayFormAttribute::getInstance(
            "reserveMobile",
            AttributeSupport::INPUT_TYPE_MOBILE,
            "备用手机号"
        )->setValidateRules(
            EleTakeawayFormValidate::mobileValidate(false)
        )->setPlaceholder(
            "请填写备用手机号"
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "shopCharge",
            AttributeSupport::INPUT_TYPE_STRING,
            "门店负责人"
        )->setValidateRules(
            EleTakeawayFormValidate::getInstance()->setRequired(true)
                                   ->setDataType(ValidateSupport::DATA_TYPE_STRING)
                                   ->setContentLength(0, 6)
        )->setPlaceholder(
            "请填写门店负责人"
        )->setValue($formContent, "");

//        EleTakeawayFormAttribute::getInstance(
//            "authorizationLetterImg",
//            AttributeSupport::INPUT_TYPE_IMG_GROUP,
//            "授权书"
//        )->setValidateRules(
//            EleTakeawayFormValidate::getInstance()->setRequired(false)
//                                      ->setDataType(ValidateSupport::DATA_TYPE_ARRAY)
//                                      ->setContentLength(1, 1)
//        )->registerHandleSaveValueFunc(
//            FormAttribute::getImgGroupSaveFunc()
//        )->setCustomAttribute(
//            ["desc", "注：后台有品牌授权书不需要展示。没有才需要展示上传"]
//        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "doorHeaderImg",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "门头照(2张)",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->setValidateRules(
            EleTakeawayFormValidate::getInstance()->setRequired(true)
                                   ->setDataType(ValidateSupport::DATA_TYPE_ARRAY)
                                   ->setContentLength(2, 2)
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setExampleImages(
            ["https://file.51kuafu.com/e6/a9/8a7ed1e45e1fd003daff39292469baab1cfb457421c6f590b35517cc057b.jpg"]
        )->setValue($formContent, []);;


        EleTakeawayFormAttribute::getInstance(
            "shopInnerImg",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "店内环境(2张)",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->setValidateRules(
            EleTakeawayFormValidate::getInstance()->setRequired(true)
                                   ->setDataType(ValidateSupport::DATA_TYPE_ARRAY)
                                   ->setContentLength(2, 2)
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setExampleImages(
            ['https://file.51kuafu.com/95/cf/8f1d2ac68f01ba1da87824c664721c5530dbb27cb0dd066b7bd3f17617b8.jpg']
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "cashierSystem",
            AttributeSupport::INPUT_TYPE_SELECT,
            "门店收银系统"
        )->setValidateRules(
            EleTakeawayFormValidate::inIntValidate(WorkOrderApplyContentModel::CASHIER_SYSTEM_MAP, true)
        )->setOptions(
            WorkOrderApplyContentModel::CASHIER_SYSTEM_MAP
        )->setValue($formContent);

    }


    /**
     * 证照信息
     */
    public function licenceForm(Collection $formContent)
    {
        EleTakeawayFormAttribute::getInstance(
            "businessLicenseImg",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "营业执照照片",
            true
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()
        )->setExampleImages(
            ["https://file.51kuafu.com/03/6c/7afb9bc267275a8448c285587d8cba592c793150406e75e1c2b9cda59690.png"]
        )->setValue($formContent, []);


        EleTakeawayFormAttribute::getInstance(
            "enterpriseName",
            AttributeSupport::INPUT_TYPE_STRING,
            "企业名称"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 72)
        )->setPlaceholder(
            "请填写企业名称"
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "businessLicenseNumber",
            AttributeSupport::INPUT_TYPE_STRING,
            "营业执照信用代码"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 36)
        )->setPlaceholder(
            "请填写营业执照信用代码"
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "foodBusinessLicenseImg",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "食品经营许可证照片",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()
        )->setExampleImages(
            ["https://file.51kuafu.com/7f/a9/ebb6877de17507547f4105acd741c8e486eb6c85e95a96ea3846669d1e1a.png"]
        )->setValue($formContent, []);


        EleTakeawayFormAttribute::getInstance(
            "legalPerson",
            AttributeSupport::INPUT_TYPE_STRING,
            "法定代表人/负责人"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 12)
        )->setCustomAttribute(
            ["placeholder", "请填写法定代表人/负责人"]
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "permitLicenseNumber",
            AttributeSupport::INPUT_TYPE_STRING,
            "许可证编号"
        )->setValidateRules(
            EleTakeawayFormValidate::getInstance()->setRequired(true)
                                   ->setDataType(ValidateSupport::DATA_TYPE_STRING)
                                   ->setContentLength(0, 32)
        )->setPlaceholder(
            "请完整填写许可证编号"
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "businessPremises",
            AttributeSupport::INPUT_TYPE_TEXT,
            "经营场所/地址"
        )->setValidateRules(
            EleTakeawayFormValidate::getInstance()->setRequired(true)
                                   ->setDataType(ValidateSupport::DATA_TYPE_STRING)
                                   ->setContentLength(0, 120)
        )->setPlaceholder(
            "请填写证件上所示的经营地址"
        )->setValue($formContent, "");


        EleTakeawayFormAttribute::getInstance(
            "effectiveTimeStartDate",
            AttributeSupport::INPUT_NEW_DATE,
            "许可证上的注册时间"
        )->setValidateRules(
            EleTakeawayFormValidate::dateValidate("Y-m-d")
        )->setPlaceholder(
            "许可证上的注册时间"
        )->setDateFormat(
            AttributeSupport::DATE_FORMAT_1
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "effectiveTimeEndDate",
            AttributeSupport::INPUT_NEW_DATE,
            "许可证上的有效期"
        )->setValidateRules(
            EleTakeawayFormValidate::dateValidate("Y-m-d")
        )->setPlaceholder(
            "许可证上的有效期"
        )->setDateFormat(
            AttributeSupport::DATE_FORMAT_1
        )->setValue($formContent, "");
    }


    /**
     * 收款人表单信息
     */
    public function collectionInformationForm(Collection $formContent)
    {

        EleTakeawayFormAttribute::getInstance(
            "collectionType",
            AttributeSupport::INPUT_TYPE_SELECT,
            "收款类型"
        )->setValidateRules(
            EleTakeawayFormValidate::getInstance()->setRequired(true)
                                   ->setDataType(ValidateSupport::DATA_TYPE_INT)
                                   ->setIn(array_keys(WorkOrderApplyContentModel::COLLECTION_TYPE_MAP))
        )->setOptions(
            WorkOrderApplyContentModel::COLLECTION_TYPE_MAP
        )->setValue($formContent, 0);

        EleTakeawayFormAttribute::getInstance(
            "collectionPersonIdentityCardFront",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "收款人身份证人像面",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionType->getInputName() => WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]]
            )
        )->setCustomAttribute(
            ["descList", WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_DESC_LIST]
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]
        )->setExampleImages(
            ["https://file.51kuafu.com/64/a4/613f464330f89f1fe43b35ba667b023178af84b4c7ef4574ed0e01c867a5.png"]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "collectionPersonIdentityCardBack",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "收款人身份证国徽面",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            FormAttribute::getImgGroupSaveFunc()
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]]
            )
        )->setCustomAttribute(
            ["descList", WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_DESC_LIST]
        )->setExampleImages(
            ["https://file.51kuafu.com/49/49/784be96a9a10a712d946f3f184b263e074aeb9cea3ed6c7b125f4ed2dd9b.png"]
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "collectionPersonIdentityCardValidityPeriod",
            AttributeSupport::INPUT_TYPE_STRING,
            "收款人身份证有效期"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 36, false)
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "collectionPersonIdentityCardWithFront",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "收款人手持身份证人像面",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]]
            )
        )->setCustomAttribute(
            ["descList", WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_DESC_LIST]
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]
        )->setExampleImages(
            [WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_HAND_IMG]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "collectionPersonIdentityCardWithBack",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "收款人手持身份证国徽面",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]]
            )
        )->setCustomAttribute(
            ["descList", WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_DESC_LIST]
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]
        )->setExampleImages(
            [WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_HAND_BACK_IMG]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "collectionPersonUsername",
            AttributeSupport::INPUT_TYPE_STRING,
            "收款人姓名"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 12)
                                   ->setExcludeEq(
                                       [[$this->collectionType->getInputName()=>
                                       WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]]
                                   )
        )->setCustomAttribute(
            ['disabled', true]
        )->setPlaceholder(
            "请填写收款人姓名"
        )->setRelations(
            [
                $this->collectionType->getInputName(),
                WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE
            ]
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "collectionPersonIdentityCardNumber",
            AttributeSupport::INPUT_TYPE_STRING,
            "收款人身份证号"
        )->setValidateRules(
            EleTakeawayFormValidate::identityCardValidate()
                                   ->setExcludeEq(
                                       [[$this->collectionType->getInputName()=>
                                       WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]]
                                   )
        )->setPlaceholder(
            "请填写收款人身份证号"
        )->setCustomAttribute(
            ['disabled', true]
        )->setRelations(
            [
                $this->collectionType->getInputName(),
                WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE
            ]
        )->setValue($formContent, "");


        EleTakeawayFormAttribute::getInstance(
            "collectionEqBankCard",
            AttributeSupport::INPUT_TYPE_SELECT,
            "商户法人和收款人是否一致"
        )->setValidateRules(
            EleTakeawayFormValidate::getInstance()
                                   ->setDataType(ValidateSupport::DATA_TYPE_INT)
                                   ->setIn(array_keys(WorkOrderApplyContentModel::COLLECTION_EQ_BANK_CARD_MAP))
                                   ->setExcludeEq([[$this->collectionType->getInputName()=>
                                       WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]])
        )->setOptions(
            WorkOrderApplyContentModel::COLLECTION_EQ_BANK_CARD_MAP
        )->setRelations(
            [
                $this->collectionType->getInputName(),
                WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE
            ]
        )->setPlaceholder(
            "请选择"
        )->setValue($formContent, "");


        EleTakeawayFormAttribute::getInstance(
            "personWithBusinessLicenseAndIdCardFrontImg",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "手持营业执照和身份证人像面合照（1张）",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionEqBankCard->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_EQ_BANK_CARD_NO,
                $this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]]
            )
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setRelations(
            [
                $this->collectionEqBankCard->getInputName(),
                WorkOrderApplyContentModel::COLLECTION_EQ_BANK_CARD_NO
            ]
        )->setValue($formContent, []);


        EleTakeawayFormAttribute::getInstance(
            "operatorAuthorizationLetter",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "经办人授权书",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionEqBankCard->getInputName()=>
                      WorkOrderApplyContentModel::COLLECTION_EQ_BANK_CARD_NO,
                  $this->collectionType->getInputName()=>
                      WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]]
            )
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setExampleFiles(
            FormAttribute::getWaimaiFormConfig('operatorAuthorizationLetter')
        )->setRelations(
            [
                $this->collectionEqBankCard->getInputName(),
                WorkOrderApplyContentModel::COLLECTION_EQ_BANK_CARD_NO
            ]
        )->setValue($formContent, []);


        EleTakeawayFormAttribute::getInstance(
            "bankCardImgFront",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "银行卡号面",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setRemark(
            "请上传银行卡号面"
        )->setExampleImages(
            ['https://file.51kuafu.com/89/b5/a09ed9e9b91ff5fa1ecee2906d6ed74b3c795bdaa6084e416aae72075ef3.png']
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]]
            )
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setRelations(
            [
                $this->collectionType->getInputName(),
                WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE
            ]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "bankCardImgBack",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "银行卡签名面",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setRemark(
            "请上传持卡人签名面"
        )->setExampleImages(
            ['https://file.51kuafu.com/18/41/7edcef0d0c9d510ceaa4e6888f1dfb12dc18a727baf151ff6bfa9640deec.png']
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE]]
            )
        )->setRelations(
            [
                $this->collectionType->getInputName(),
                WorkOrderApplyContentModel::COLLECTION_TYPE_PRIVATE
            ]
        )->setValue($formContent, []);


        EleTakeawayFormAttribute::getInstance(
            "accountBank",
            AttributeSupport::INPUT_TYPE_STRING,
            "开户银行全称"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 20)
        )->setPlaceholder(
            "请填写开户银行全称"
        )->setValue($formContent, "");


        EleTakeawayFormAttribute::getInstance(
            "provinceBank",
            AttributeSupport::INPUT_TYPE_STRING,
            "银行所在省市区"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 20, false)
        )->setPlaceholder(
            "请填写银行所在省市区"
        )->setReject()->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "accountBranchBank",
            AttributeSupport::INPUT_TYPE_STRING,
            "开户支行"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 20)
        )->setPlaceholder(
            "请填写开户支行"
        )->setReject()->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "collectionBankAccount",
            AttributeSupport::INPUT_TYPE_STRING,
            "收款账号"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 36)
        )->setPlaceholder(
            "请填写收款账号"
        )->setValue($formContent, "");


        EleTakeawayFormAttribute::getInstance(
            "bankReserveMobile",
            AttributeSupport::INPUT_TYPE_MOBILE,
            "银行预留手机号"
        )->setValidateRules(
            EleTakeawayFormValidate::mobileValidate()
        )->setPlaceholder(
            "请填写银行预留手机号"
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "accountOpenPermitImg",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "开户许可证（盖公章）",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()
                                   ->setExcludeEq(
                                       [[$this->collectionType->getInputName()=>
                                       WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]]
                                   )
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]
        )->setExampleImages(
            ["https://file.51kuafu.com/39/b7/e2835b41e6b90e799c812de9b2bcf1ec942ad11f43dd87d40d3a6d0c247b.png"]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "bankReceiptImg",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "对公账户银行回执单截图",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()
                                   ->setExcludeEq(
                                       [[$this->collectionType->getInputName()=>
                                       WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]]
                                   )
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]
        )->setExampleImages(
            ["https://img.51kuafu.com/1/0/6c2c3c82965fed85aef3e6abd831995d.jpeg"]
        )->setValue($formContent, []);


        EleTakeawayFormAttribute::getInstance(
            "legalPersonIdentityCardFront",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "法人身份证人像面",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]]
            )
        )->setCustomAttribute(
            ["descList", WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_DESC_LIST]
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]
        )->setExampleImages(
            ["https://file.51kuafu.com/64/a4/613f464330f89f1fe43b35ba667b023178af84b4c7ef4574ed0e01c867a5.png"]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "legalPersonIdentityCardBack",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "法人身份证国徽面",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]]
            )
        )->setCustomAttribute(
            ["descList", WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_DESC_LIST]
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]
        )->setExampleImages(
            ["https://file.51kuafu.com/49/49/784be96a9a10a712d946f3f184b263e074aeb9cea3ed6c7b125f4ed2dd9b.png"]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "legalPersonIdentityCardWithFront",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "法人手持身份证人像面",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]]
            )
        )->setCustomAttribute(
            ["descList", WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_DESC_LIST]
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]
        )->setExampleImages(
            [WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_HAND_IMG]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "legalPersonIdentityCardWithBack",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "法人手持身份证国徽面",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate()->setExcludeEq(
                [[$this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]]
            )
        )->setCustomAttribute(
            ["descList", WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_DESC_LIST]
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]
        )->setExampleImages(
            [WorkOrderApplyContentModel::DEFAULT_PERSON_IDENTITY_CARD_HAND_BACK_IMG]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "legalPersonIdentityCardValidityPeriod",
            AttributeSupport::INPUT_TYPE_STRING,
            "法人身份证有效期"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 36, false)->setExcludeEq(
                [[$this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]]
            )
        )->setRelations(
            [$this->collectionType->getInputName(), WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "legalPersonUsername",
            AttributeSupport::INPUT_TYPE_STRING,
            "法人姓名"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 12)->setExcludeEq(
                [[$this->collectionType->getInputName()=>
                WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]]
            )
        )->setPlaceholder(
            "请填写法人姓名"
        )->setCustomAttribute(
            ['disabled', true]
        )->setRelations(
            [
                $this->collectionType->getInputName(),
                WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC
            ]
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "legalPersonIdentityCardNumber",
            AttributeSupport::INPUT_TYPE_STRING,
            "法人身份证号"
        )->setValidateRules(
            EleTakeawayFormValidate::identityCardValidate()
                                   ->setExcludeEq(
                                       [[$this->collectionType->getInputName()=>
                                       WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC]]
                                   )
        )->setPlaceholder(
            "请填写法人身份证号"
        )->setCustomAttribute(
            ['disabled', true]
        )->setRelations(
            [
                $this->collectionType->getInputName(),
                WorkOrderApplyContentModel::COLLECTION_TYPE_PUBLIC
            ]
        )->setValue($formContent, "");
    }


    public function specialQualificationFoodCityStoreForm(Collection $formContent)
    {
        EleTakeawayFormAttribute::getInstance(
            "shopInFoodCity",
            AttributeSupport::INPUT_TYPE_SELECT,
            "门店是否开在美食城内"
        )->setValidateRules(
            EleTakeawayFormValidate::getInstance()->setRequired(true)
                                   ->setDataType(ValidateSupport::DATA_TYPE_INT)
                                   ->setIn(array_keys(WorkOrderApplyContentModel::STORE_IN_FOOD_CITY_MAP))
        )->setCustomAttribute(
            [
                "options",
                ValidateSupport::buildOptionsFromEnum(WorkOrderApplyContentModel::STORE_IN_FOOD_CITY_MAP)
            ]
        )->setPlaceholder(
            "是/否"
        )->setValue($formContent, WorkOrderApplyContentModel::STORE_IN_FOOD_CITY_NO);

        EleTakeawayFormAttribute::getInstance(
            "foodCityGearList",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "美食城档口列表",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate(true)
                                   ->setExcludeEq(
                                       [[$this->shopInFoodCity->getInputName()=>
                                       WorkOrderApplyContentModel::STORE_IN_FOOD_CITY_YES]]
                                   )
        )->setExampleFiles(
            FormAttribute::getWaimaiFormConfig('foodCityGearList')
        )->setRelations(
            [$this->shopInFoodCity->getInputName(), WorkOrderApplyContentModel::STORE_IN_FOOD_CITY_YES]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "eleShopWithGearCommitmentLetter",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "饿了么外卖一店多档口承诺书",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate(true)
                                   ->setExcludeEq(
                                       [[$this->shopInFoodCity->getInputName()=>
                                       WorkOrderApplyContentModel::STORE_IN_FOOD_CITY_YES]]
                                   )
        )->setExampleFiles(
            FormAttribute::getWaimaiFormConfig('eleShopWithGearCommitmentLetter')
        )->setRelations(
            [$this->shopInFoodCity->getInputName(), WorkOrderApplyContentModel::STORE_IN_FOOD_CITY_YES]
        )->setValue($formContent, []);


        EleTakeawayFormAttribute::getInstance(
            "operatorWithHealthCertificate",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "经营人手持健康证正反面（2张）",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate(true, 2, 2)
                                   ->setExcludeEq(
                                       [[$this->shopInFoodCity->getInputName()=>
                                       WorkOrderApplyContentModel::STORE_IN_FOOD_CITY_YES]]
                                   )
        )->setRelations(
            [$this->shopInFoodCity->getInputName(), WorkOrderApplyContentModel::STORE_IN_FOOD_CITY_YES]
        )->setValue($formContent, []);

        EleTakeawayFormAttribute::getInstance(
            "foodCityVideo",
            AttributeSupport::INPUT_VIDEO,
            "美食城视频（五分钟内）",
            true
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->setValidateRules(
            EleTakeawayFormValidate::videoGroupValidate(true)
                                   ->setExcludeEq(
                                       [[$this->shopInFoodCity->getInputName()=>
                                       WorkOrderApplyContentModel::STORE_IN_FOOD_CITY_YES]]
                                   )
        )->setExampleVideos(
            ["https://file.51kuafu.com/13/7c/5253bcc6e6e318d2c0dc7e1b3f5283578c639d822ac4c4f1ccd7d9a8a0b8.mp4"]
        )->setRelations(
            [$this->shopInFoodCity->getInputName(), WorkOrderApplyContentModel::STORE_IN_FOOD_CITY_YES]
        )->setValue($formContent, []);
    }

    /**
     * 督导表单信息
     *
     * @param Collection $formContent
     */
    public function shopSupervisorForm(Collection $formContent)
    {
        EleTakeawayFormAttribute::getInstance(
            "shopSupervisorName",
            AttributeSupport::INPUT_TYPE_STRING,
            "督导姓名"
        )->setValidateRules(
            EleTakeawayFormValidate::stringValidate(0, 12, false)
        )->setPlaceholder(
            "请填写督导姓名"
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "shopSupervisorMobile",
            AttributeSupport::INPUT_TYPE_STRING,
            "督导联系方式"
        )->setValidateRules(
            EleTakeawayFormValidate::mobileValidate(false)
        )->setPlaceholder(
            "请填写督导联系方式"
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "communicationTime",
            AttributeSupport::INPUT_NEW_DATE,
            "沟通日期"
        )->setValidateRules(
            EleTakeawayFormValidate::dateValidate("Y-m-d")
        )->setPlaceholder(
            "沟通日期"
        )->setCustomAttribute(
            ["format", "YYYY-MM-DD"]
        )->setValue($formContent, "");

        EleTakeawayFormAttribute::getInstance(
            "evaluationScreenshot",
            AttributeSupport::INPUT_TYPE_IMG_GROUP,
            "督导/外卖运营的评估截图（是否上线外卖）",
            true
        )->setValidateRules(
            EleTakeawayFormValidate::imgGroupValidate(true)
        )->setCustomAttribute(
            ["download", true],
            ["check", true]
        )->registerHandleSaveValueFunc(
            EleTakeawayFormAttribute::getImgGroupSaveFunc()
        )->setCustomAttribute(
            [
                "descList",
                [
                    "外卖上线条件评估：",
                    "1、新开门店建议试营业后，做好堂食质量，再申请开通外卖",
                    "2、申请外卖开通需要先联系督导或外卖运营进行评估，评估通过后再提交申请"
                ]
            ]
        )->setExampleImages(
            ["https://file.51kuafu.com/e6/d2/35419a003ae653963048a85dd700c99f2856e3f1a8b7a113a051bb9e0a6b.jpeg"]
        )->setPlaceholder(
            "督导/外卖运营的评估截图（是否上线外卖）"
        )->setValue($formContent, "");
    }

    /**
     * 期望开通时间
     */
    public function expectOpenTimeForm(Collection $formContent)
    {
        EleTakeawayFormAttribute::getInstance(
            "expectOpenTime",
            AttributeSupport::INPUT_NEW_DATE,
            "期望开通时间"
        )->setValidateRules(
            EleTakeawayFormValidate::dateValidate("Y-m-d")
        )->setCustomAttribute(
            ["format", "YYYY-MM-DD"]
        )->setValue($formContent, "");
    }


    /**
     * @param Collection $formContent
     * @return $this
     */
    public function renderForm(Collection $formContent): EleTakeawayForm
    {
        //门店信息
        $this->shopInfoForm($formContent);
        //收款人信息
        $this->collectionInformationForm($formContent);
        //收货人信息
        $this->licenceForm($formContent);
        $this->specialQualificationFoodCityStoreForm($formContent);
        //督导表单信息
        $this->shopSupervisorForm($formContent);
        //期望开店时间
        $this->expectOpenTimeForm($formContent);
        return $this;
    }


    /**
     * @return array[]
     * workOrderNo
     */
    public function getFormContent(): array
    {

        return [
            [
                "title"      => "门店督导信息",
                "attributes" => collect([
                    $this->shopSupervisorName,
                    $this->shopSupervisorMobile,
                    $this->communicationTime,
                    $this->evaluationScreenshot,
                ])->map(function (EleTakeawayFormAttribute $attribute) {
                    return $attribute->build();
                })->values()->toArray(),
            ],
            [
                "title"      => "门店信息",
                "attributes" => collect([
                    $this->shopCode,
                    $this->shopName,
                    $this->address,
                    $this->detailAddress,
                    $this->cashierSystem,
                    $this->businessTime,
                    $this->mobile,
                    $this->reserveMobile,
                    $this->shopCharge,
                    $this->doorHeaderImg,
                    $this->shopInnerImg,
                ])->map(function (EleTakeawayFormAttribute $attribute) {
                    return $attribute->build();
                })->values()->toArray(),
            ],
            [
                "title"      => "证照信息",
                "attributes" => collect([
                    $this->businessLicenseImg,
                    $this->enterpriseName,
                    $this->businessLicenseNumber,
                    $this->foodBusinessLicenseImg,
                    $this->legalPerson,
                    $this->permitLicenseNumber,
                    $this->businessPremises,
                    $this->effectiveTimeStartDate,
                    $this->effectiveTimeEndDate,
                ])->map(function (EleTakeawayFormAttribute $attribute) {
                    return $attribute->build();
                })->values()->toArray(),
            ],
            [
                "title"      => "收款信息",
                "attributes" => collect([
                    $this->collectionType,
                    $this->accountOpenPermitImg,
                    $this->bankReceiptImg,
                    $this->legalPersonIdentityCardFront,
                    $this->legalPersonIdentityCardBack,
                    $this->legalPersonIdentityCardValidityPeriod,
                    $this->legalPersonIdentityCardWithFront,
                    $this->legalPersonIdentityCardWithBack,
                    $this->legalPersonUsername,
                    $this->legalPersonIdentityCardNumber,


                    $this->collectionPersonIdentityCardFront,
                    $this->collectionPersonIdentityCardBack,
                    $this->collectionPersonIdentityCardWithFront,
                    $this->collectionPersonIdentityCardWithBack,
                    $this->collectionPersonIdentityCardValidityPeriod,
                    $this->collectionPersonUsername,
                    $this->collectionPersonIdentityCardNumber,
                    $this->collectionEqBankCard,
                    $this->personWithBusinessLicenseAndIdCardFrontImg,
                    $this->operatorAuthorizationLetter,

                    $this->bankCardImgFront,
                    $this->bankCardImgBack,
                    $this->accountBank,
                    $this->provinceBank,
                    $this->accountBranchBank,
                    $this->collectionBankAccount,
                    $this->bankReserveMobile,
                ])->map(function (EleTakeawayFormAttribute $attribute) {
                    return $attribute->build();
                })->values()->toArray(),
            ],
            [
                "title"      => "美食城门店特殊资质",
                "attributes" => collect([
                    $this->shopInFoodCity,
                    $this->foodCityGearList,
                    $this->eleShopWithGearCommitmentLetter,
                    $this->operatorWithHealthCertificate,
                    $this->foodCityVideo,
                ])->map(function (EleTakeawayFormAttribute $attribute) {
                    return $attribute->build();
                })->values()->toArray(),
            ],
            [
                "title"      => "期望开通时间",
                "attributes" => collect([
                    $this->expectOpenTime,
                ])->map(function (EleTakeawayFormAttribute $attribute) {
                    return $attribute->build();
                })->values()->toArray(),
            ],
        ];
    }


//    /**
//     * @param string $field
//     * @param $value
//     * @param array $extraParams
//     * @return mixed
//     */
//    public function validate(string $field, $value, array $extraParams = [])
//    {
//        // TODO: Implement save() method.
//        CustomerValidator::extend(
//            'exclude_eq',
//            function ($attribute, $value, $parameters, Validator $validator) {
//                $validator->requireParameterCount(2, $parameters, 'eq');
//                $eqFieldName   = $parameters[0];
//                $eqFieldValue  = $parameters[1];
//                $nowFieldValue = $validator->getData()["$eqFieldName"];
//
//                return $eqFieldValue == $nowFieldValue;
//            }, "当前状态暂不支持修改 【:attribute】 字段");
//
//        return parent::validate($field, $value, $extraParams);
//    }

    /**
     * @param $name
     * @return AttributeSupport
     */
    public function __get($name)
    {
        // TODO: Change the autogenerated stub
        return $this->getAttributeMap()->{$name};
    }

    /**
     * @return AttributeMapSupport
     */
    public function getAttributeMap(): AttributeMapSupport
    {
        // TODO: Implement getAttributeValidateClassName() method.
        return EleTakeawayFormAttribute::$attributesMap;
    }
}
